/**
 * 
 */
package com.softqin.washer.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.softqin.washer.R;
import com.softqin.washer.bean.OrdersBean;

/** 

 * @ClassName: HomeOrderListAdapter 

 * @Description: ��ҳ����������

 * @author ����־

 * @date 2015-1-8 ����7:58:30 

 */
public class HomeOrderListAdapter extends BaseAdapter{
	private Context mContext;
	private LayoutInflater inflater;
	private List<OrdersBean> mList;
	public HomeOrderListAdapter(List<OrdersBean> list,Context context){
		mContext=context;
		mList=list;
		inflater=LayoutInflater.from(mContext);
	}

	@Override
	public int getCount() {
		return mList.size();
	}

	@Override
	public Object getItem(int position) {
		return mList.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder viewHolder;
		if (convertView==null) {
			viewHolder=new ViewHolder();
			convertView=inflater.inflate(R.layout.homeorder_list_item, null);
			viewHolder.washImg=(ImageView)convertView.findViewById(R.id.homeorder_item_img);
			viewHolder.orderNumberTv=(TextView)convertView.findViewById(R.id.homeorder_item_number);
			viewHolder.dateTv=(TextView)convertView.findViewById(R.id.homeorder_item_date);
			viewHolder.washNameTv=(TextView)convertView.findViewById(R.id.homeorder_item_name);
			viewHolder.serverTv=(TextView)convertView.findViewById(R.id.homeorder_item_server);
			viewHolder.confirmStateTv=(TextView)convertView.findViewById(R.id.homeorder_item_confirm);
			viewHolder.judgeStateTv=(TextView)convertView.findViewById(R.id.homeorder_item_judge);
			convertView.setTag(viewHolder);
			
		}else{
			viewHolder=(ViewHolder)convertView.getTag();
		}
		return convertView;
	}
	private class ViewHolder{
		ImageView washImg;
		TextView orderNumberTv;
		TextView dateTv;
		TextView washNameTv;
		TextView serverTv;
		TextView confirmStateTv;
		TextView judgeStateTv;
		
	}

}
